package com.yijiue.ace.configuration;

import com.yijiue.ace.core.task.RefreshConfigTask;
import com.yijiue.ace.service.AceGrayService;
import com.yijiue.ace.service.AceRouteDefineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 初始化刷新配置类
 * @author YIJIUE
 */
@Configuration
public class RefreshConfiguration {

    @Autowired
    private AceGrayService aceGrayService;
    @Autowired
    private AceRouteDefineService aceRouteDefineService;

    @Bean
    public RefreshConfigTask init(){
        RefreshConfigTask refreshConfigTask = new RefreshConfigTask(aceGrayService, aceRouteDefineService);
        refreshConfigTask.start();
        return refreshConfigTask;
    }

}
